{include file="public/header"}
</head>
<style>
    .layui-input {
        width: 50px;
    }

    .layui-bg-green,
    .layui-bg-orange {
        padding: 5px 8px;
        border-radius: 5px;
    }
</style>

<body>
    <div class="cBody">
        <div class="console">
            <button class="layui-btn" onclick="OpenView('{:url('MenusItem/add')}', '菜单添加')">菜单添加</button>
        </div>

        <table class="layui-table">
            <thead>
                <tr>
                    <th>名称</th>
                    <th>控制器</th>
                    <th>方法</th>
                    <th>显示</th>
                    <th>排序</th>
                    <th>添加时间</th>
                    <th>更新时间</th>
                    <th>描述</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody class="layui-form">
                {volist name="list" id="v"}
                <tr>
                    <td>{php}echo str_repeat('&emsp;&emsp;',$v['level']*1);{/php}{if $v['ico']!=''}<i
                            class="{$v.ico}"></i>{/if}{$v.name}
                    </td>
                    <td>{$v.controller}</td>
                    <td>{$v.action}</td>
                    <td>
                        {if $v['is_show']==1}
                        <a href="#" class="layui-bg-green" onclick="shortcuts('menus','{$v.id}','is_show',this,'{:url('Login/shortcuts')}')">显示</a>
                        {else/}
                        <a href="#" class="layui-bg-orange" onclick="shortcuts('menus','{$v.id}','is_show',this,'{:url('Login/shortcuts')}')">隐藏</a>
                        {/if}
                    </td>
                    <td>
                        <input class="layui-input" type="tel" maxlength="3" oninput="value=value.replace(/[^\d]/g,'')"
                            onblur="shortcuts('menus','{$v.id}','px',this,'{:url('Login/shortcuts')}')" value="{$v.px}">
                    </td>
                    <td>{$v.add_date|date="Y-m-d"}</td>
                    <td>{$v.rep_date=="0"?'/':date("Y-m-d",$v.rep_date)}</td>
                    <td>{$v.desc}</td>
                    <td>
                        <button class="layui-btn layui-btn-xs"
                            onclick="OpenView('{:url('MenusItem/edit')}?id={$v.id}','菜单编辑')">编辑</button>
                        <button class="layui-btn layui-btn-danger layui-btn-xs"
                            onclick="del('{:url('MenusItem/del')}','{$v.id}');">删除</button>
                    </td>
                </tr>
                {/volist}
            </tbody>
        </table>
    </div>
</body>
<script>
    layui.use('form', function () {
        var form = layui.form;
        form.render();//表单重新渲染
    });
</script>
{include file="public/footer"}